{include file="public/header"}
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>账号管理</title>
    <link rel="stylesheet" type="text/css" href="__CSS__/tt.css" />
    <style>
        html,
        body {
            margin:0;
            padding:0;
            width: 100%;
            background: rgba(238, 238, 238, 1);
        }
        .tt_top11{
            background:#3F3F3F;
        }
        .tt_top22{
            background:#fff;
        }
        .tt_top33{
            background:#2A63E7;
        }
        .container {
            padding-top: 30px;
            padding-bottom: 73px;
        }

        .box {
            width: 1200px;
            height: 821px;
            margin: 0 auto;
            padding-bottom: 30px;
            background-color: #FFFFFF;
            border-radius:3px;
        }

        .box_1 {
            padding-left: 30px;
            padding-right: 30px;
            height: 70px;
        }
        .box1{
            padding-left:30px;
            padding-right:30px;
        }
        .tablee{
            font-size:12px;
            color:#666;
            font-weight:600;
            background:#F7F7F7;
            height:50px;
            border-radius:4px 4px 0px 0px;
            display: flex;
            align-items: center;
        }
        .tablee1{
            background:#fff;
            font-weight:400;
            border-bottom:1px solid #E9E9E9;
        }
        .tdd{
            width:228px;
            text-align: center;
        }
        .tdd1{
            font-size:0;
        }
        .name111 {
            width: 24px;
            font-size: 12px;
            font-weight: 400;
            color: rgba(0, 101, 240, 1);
            margin-right: 10px;
        }
        .xia {
            font-weight: 600;
            color: rgba(51, 51, 51, 1);
        }
        .hidden{
            display: none
        }
    </style>
</head>

<body>

<header class="tt_topAll">
    <div class="tt_top3">
        <div class="tt_top33">账号管理</div>
    </div>
</header>

<div class="container">
    <div class="box">
        <div class="box_1 flex-wrap">

            <div class="flex-con"></div>
            <div class="selectttt3" style="margin-top: 19px;
    width: 100px;
    height: 30px;
    background: rgba(0, 101, 240, 1);
    border-radius: 3px;
    text-align: center;
    line-height: 28px;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 1);cursor: pointer;" onclick="location.href = '/shop/account/add'">新增账号</div>
        </div>
        <div class="box1">
            <div class="tablee">
                <div class="tdd">序号</div>
                <div class="tdd">名称</div>
                <div class="tdd">账号</div>
                <div class="tdd">角色</div>
                <div class="tdd">状态</div>
                <div class="tdd">备注</div>
                <div class="tdd">创建时间</div>
                <div class="tdd">操作</div>
            </div>
            {foreach name="data" item="vo"}
                <div class="tablee tablee1">
                    <div class="tdd">{$key+1}</div>
                    <div class="tdd">{$vo.role_name}</div>
                    <div class="tdd">{$vo.role_user}</div>
                    <div class="tdd">{$vo.role_name1}</div>
                    {if $vo['role_status']==1}
                    <div class="tdd">开启</div>
                    {else /}
                    <div class="tdd">禁用</div>
                    {/if}
                    <div class="tdd">{$vo.role_into}</div>
                    <div class="tdd">{$vo.role_time}</div>
                    <div class="tdd tdd1">
                        <span class="name111" style="cursor: pointer;"onclick="location.href = '/shop/account/update?id='+{$vo.role_name_id};" >编辑</span>
                        {if $vo['role_status']==2}
                        <span class="name111 start" style="cursor: pointer;" data-id="{$vo.role_name_id}">启用</span>
                        {else /}
                        <span class="name111 end" style="cursor: pointer;" data-id="{$vo.role_name_id}">禁用</span>
                        {/if}
                        <span class="name111 del" style="cursor: pointer;" data-id="{$vo.role_name_id}">删除</span>
                    </div>
                </div>
            {/foreach}
        </div>
    </div>
</div>
</body>
{include file="public/footer"}
</html>
<script>
    /*下架*/
    $(".del").click(function () {
        if(confirm('确认删除？')){
            var id = $(this).attr('data-id');
            $.ajax({
                url: '/shop/account/del',
                data: {id:id},
                type: 'POST',
                dataType: 'JSON',
                success: function (returnData) {
                    alert(returnData.msg);
                    if(returnData.status == 200){
                        location.reload();
                    }
                },

            })
        }
    });
    $(".start").click(function () {
        if(confirm('确认启用？')){
            var id = $(this).attr('data-id');
            $.ajax({
                url: '/shop/account/status',
                data: {id:id,type:1},
                type: 'POST',
                dataType: 'JSON',
                success: function (returnData) {
                    alert(returnData.msg);
                    if(returnData.status == 200){
                        location.reload();
                    }
                },

            })
        }
    });
    $(".end").click(function () {
        if(confirm('确认禁用？')){
            var id = $(this).attr('data-id');
            $.ajax({
                url: '/shop/account/status',
                data: {id:id,type:2},
                type: 'POST',
                dataType: 'JSON',
                success: function (returnData) {
                    alert(returnData.msg);
                    if(returnData.status == 200){
                        location.reload();
                    }
                },

            })
        }
    });
</script>
